﻿<%@ Page Title="Create New Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PageNew.aspx.cs" Inherits="Altairis.Sewen.WebApp.Sewen.PageNew" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainCPH" runat="server">
    <asp:FormView ID="PageFormView" runat="server" DataSourceID="PageObjectDataSource" RenderOuterTable="false" DefaultMode="Insert" OnItemCommand="PageFormView_ItemCommand" OnItemInserted="PageFormView_ItemInserted">
        <InsertItemTemplate>
            <h1 class="title">Create New Page</h1>
            <div class="body">
                <p>
                    <asp:Label runat="server" Text="Title:" AssociatedControlID="TitleTextBox" />
                    <br />
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Title") %>' />
                </p>
                <p>
                    <asp:Label runat="server" Text="Body:" AssociatedControlID="BodyTextBoxHtml" />
                    <br />
                    <asp:TextBox ID="BodyTextBoxHtml" runat="server" Text='<%# Bind("Body") %>' TextMode="MultiLine" Height="300px" />
                </p>
            </div>
            <div class="buttons">
                <asp:RequiredFieldValidator runat="server" ControlToValidate="TitleTextBox" ErrorMessage="Title is missing" Display="None" />
                <asp:RequiredFieldValidator runat="server" ControlToValidate="BodyTextBoxHtml" ErrorMessage="Body is missing" Display="None" />
                <asp:ValidationSummary runat="server" />
                <asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
                <asp:Button ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
            </div>
        </InsertItemTemplate>
    </asp:FormView>
    <asp:ObjectDataSource ID="PageObjectDataSource" runat="server" TypeName="Altairis.Sewen.PageStoreManager" DataObjectTypeName="Altairis.Sewen.SewenPage" InsertMethod="SavePage" />
</asp:Content>
